Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 7 - Process Management / Process Management Reference
Functions / Working With System Tasks


OTDestroySystemTask

Destroys a system task created with the OTCreateSystemTask function.

C INTERFACE
OSStatus OTDestroySystemTask(long stCookie)
C++ INTERFACES
None. C++ applications use the C interface to this function.

PARAMETERS
stCookie
A reference value that identifies the system task to be destroyed.
DESCRIPTION
The OTDestroySystemTask function makes the stCookie reference invalid and frees any resources allocated to the task when it was created. You can call this function when you no longer need to schedule the system task, such as when it has already been executed at its scheduled time and you have no plans to reschedule it for later use. If stCookie is already invalid (a value of 0), the function returns kOTNoError and does nothing.

If you try to destroy a task that is still scheduled for execution, the OTDestroySystemTask function cancels it first, so that it is no longer scheduled for system task execution, and then destroys it. If the task has already been canceled, the OTDestroySystemTask function simply destroys it.

SEE ALSO
To create a system task, call the OTCreateSystemTask function (page 7-9).

To schedule a task for execution at system task time, call the OTScheduleSystemTask function (page 7-10).

To cancel a task scheduled for execution at system task time, call the OTCancelSystemTask function (page 7-12).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996